﻿@{
    Layout = "_Layout.cshtml";
    var parentCategory=ViewBag.dataHelper.Categories(ViewBag.category.ParentId);
}   <section id="page-breadcrumb">
        <div class="vertical-center sun">
             <div class="container">
                <div class="row">
                    <div class="action">
                        <div class="col-sm-12">
                            <h1 class="title">@ViewBag.Title | @ViewBag.sysConfig["cfg_webname"]</h1>
                            <p> @ViewBag.category.Description</p>
                        </div>                                                                                
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--/#page-breadcrumb-->
    <section id="blog" class="padding-top">
        <div class="container">
            <div class="row">
                <div class="col-md-9 col-sm-7">
                    @if(ViewBag.articles.Count>0){
                    <div class="row">
                        @foreach (var item in ViewBag.articles){
                        <div class="col-md-12 col-sm-12">
                            <div class="single-blog two-column">
                                @if(!string.IsNullOrEmpty(item.TitleImg.Trim())){
                                <div class="post-thumb">
                                    <a href="@item.RedirectUrl"><img src="@item.TitleImg" class="img-responsive" alt="@item.Title"></a>
                                    <div class="post-overlay">
                                        <span class="uppercase"><a href="#">14 <br><small>Feb</small></a></span>
                                    </div>
                                </div>
                                }
                                <div class="post-content overflow">
                                    <h2 class="post-title bold"><a href="@item.RedirectUrl">@item.Title</a></h2>
                                    <h3 class="post-author">@item.Author</h3>
                                    <p>@item.Description [...]</p>
                                    <a href="@item.RedirectUrl" class="read-more">View More</a>
                                    <div class="post-bottom overflow">
                                        <ul class="nav navbar-nav post-nav">
                                            <li><a href="#"><i class="fa fa-tag"></i>Creative</a></li>
                                            <li><a href="#"><i class="fa fa-heart"></i>32 Love</a></li>
                                            <li><a href="#"><i class="fa fa-comments"></i>3 Comments</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        }
                    </div>
                    <div class="blog-pagination">
                        @RenderPage("_Pagination.cshtml",ViewBag.pagination)
                    </div>
                    }else{
                    <div class="alert alert-info fade in">
                        <h4>无数据</h4>
                        <p><b>抱歉</b>:您浏览的 @ViewBag.Title 暂时没有数据。</p>
                    </div>
                    }
                 </div>
                <div class="col-md-3 col-sm-5">
                    <div class="sidebar blog-sidebar">
                        <div class="sidebar-item categories">
                            <h3>类目</h3>
                            @if(ViewBag.category.subCategory.Count>0){
                            <ul class="nav navbar-stacked">
                                @foreach (var item in ViewBag.category.subCategory){
                                <li><a href="@item.RedirectUrl">@item.CategoryName<span class="pull-right">(@item.ArticleTotal)</span></a></li>
                                }
                            </ul>
                            }else if(parentCategory!=null){
                            <ul class="nav navbar-stacked">
                                @foreach (var item in parentCategory.subCategory){
                                    if(item.Id==ViewBag.category.Id){
                                    <li class="active"><a href="@item.RedirectUrl">@item.CategoryName<span class="pull-right">(@item.ArticleTotal)</span></a></li>
                                    }else{
                                    <li><a href="@item.RedirectUrl">@item.CategoryName<span class="pull-right">(@item.ArticleTotal)</span></a></li>
                                    }
                                }
                            </ul>
                            }
                        </div>
                        
                        <div class="sidebar-item tag-cloud">
                            <h3>标签</h3>
                            <ul class="nav nav-pills">
                                <li><a href="#">Corporate</a></li>
                                <li><a href="#">Joomla</a></li>
                                <li><a href="#">Abstract</a></li>
                                <li><a href="#">Creative</a></li>
                                <li><a href="#">Business</a></li>
                                <li><a href="#">Product</a></li>
                            </ul>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--/#blog-->
